/**
 * 集合接口
 * License: BSD
 * Authors: Lucifer (786325481@QQ.com)
 * Copyright: Copyright (C) 2008 Lucifer. All rights reserved.
 */

module system.collections.ICollection;

import system.collections.IEnumerable;

/** Define some methods for collection operation */
public interface ICollection(T) : IEnumerable!(T)
{
    /** Returns <tt>true</tt> if this collection contains no elements. */
    bool isEmpty();
    /** Get the number of items in the collection */
    int count();
    /** Detect whether the collection is read only */
    bool isReadOnly();
    /** Add an item into the collection */
    bool add( T item);
    /** Clear the collection */
    void clear();
    /** Remove an item in the collection  */
    bool remove( T item );
    /** Detect whether the collection contains an item */
    bool contains( T item);
    alias contains opIn;
    /**
     * toArray copies a collection into an array.
     */
    void toArray( T[] array);
}
